We have developed computer methods to predict protein three-dimensional structure by recognition of folding motif. A protein's sequence is "threaded" through alternative backbone structures in a database, and the conformations most compatible with that sequence are identified by approximate free-energy calculation, using contact potentials. The work has focused on two areas: 1) development of algorithms for fast, "adaptive" threading, and 2) construction of a database of "core" folding motifs. We have found that optimal alignments of a sequence and structure may be identified using a Gibbs Sampling procedure. The algorithm samples alternative alignments of subsequence blocks with the ungapped core elements which define the folding motif. Alternative boundaries of the core elements within the structure are also sampled, so that the optimal definition of common core substructure may be identified. This adaptive approach to fold ecognition preserves the favorable statistical properties of block alignment, yet allows identification of optimal core substructures from an approximate starting point, such as an automatic definition based on secondary structural elements. To build a database of folding motifs we have identified the large helices and beta strands within structures from the protein Data Bank. For this purpose we have developed an algorithm based on matching of alpha-carbon distance matrices against paradigm helices and beta-ladders, optimized to be robust against local distortions and/or coordinate imprecision. This core folding motif database has been tested-as the target for a threading search of known structures, using the adaptive threading algorithm. The significance of this research is that these methods may allow 3- dimensional modeling for sequences only distantly related to proteins of known structure, and in this way suggest hypotheses as to their mechanism of action and function.